import httpRequest from '@/utils/httpRequest'

// 上传文件
export const bigitalFileUpload = (data) => {
  // return request({
  //   url: "/bigital/file/upload",
  //   method: "post",
  //   data,
  //   headers: {
  //     'Content-Type': 'multipart/form-data'
  //   }
  // });
  return httpRequest({
    url: httpRequest.adornUrl('/bigital/file/upload'),
    method: 'post',
    data: httpRequest.adornData({
      ...data
    }),
    headers: {
      'Content-Type': 'multipart/form-data'
    }    
  })  
};

// 图文列表
export const bigitalImageTextList = (data) => {
  // return request({
  //   url: "/bigital/imageText/list",
  //   method: "post",
  //   data
  // });
  // console.log('bigitalImageTextList', httpRequest)
  return httpRequest({
    url: httpRequest.adornUrl('/bigital/imageText/list'),
    method: 'post',
    data: httpRequest.adornData({
      ...data
    })
  })
  
  // .then(({data}) => {
  //   this.tableData = data.data.records;
  //   this.queryParams.total = data.data.total;
  // }).finally(() => {
  //   this.loading = false;
  // });  

};


// 图文新增
export const bigitalImageTextAdd = (data) => {
  // return request({
  //   url: "/bigital/imageText/add",
  //   method: "post",
  //   data
  // });
  return httpRequest({
    url: httpRequest.adornUrl('/bigital/imageText/add'),
    method: 'post',
    data: httpRequest.adornData({
      ...data
    })
  })   
};

// 图文删除
export const bigitalImageTextDelete = (data) => {
  return httpRequest({
    url: httpRequest.adornUrl('/bigital/imageText/delete'),
    method: 'post',
    data: httpRequest.adornData({
      ...data
    })
  })   
};

// 图文更新
export const bigitalImageTextUpdate = (data) => {
  // return request({
  //   url: "/bigital/imageText/update",
  //   method: "post",
  //   data
  // });
  return httpRequest({
    url: httpRequest.adornUrl('/bigital/imageText/update'),
    method: 'post',
    data: httpRequest.adornData({
      ...data
    })
  })  
};

// 图文详情
export const bigitalImageTextDetail = (data) => {
  // return request({
  //   url: "/bigital/imageText/datail",
  //   method: "post",
  //   data
  // });
  return httpRequest({
    url: httpRequest.adornUrl('/bigital/imageText/datail'),
    method: 'post',
    data: httpRequest.adornData({
      ...data
    })
  })  
};
